package com.my.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.util.Arrays;

/**
 * 参数校验AOP <br/>
 * @Order(1) 参数值越小，表示优先级越高
 */
@Order(10)
@Aspect
@Component
public class ValidAspect {

	/**
	 * 对LogAspect中已经定义的切点进行切入
	 */
	@Before("com.my.aop.LogAspect.cut()")
	public void validateArgs(JoinPoint joinPoint){
		System.out.println(String.format("====>ValidAspect, order = 10, get args = %s", Arrays.asList(joinPoint.getArgs())));
	}
	
}
